package cn.itsource.ymcc.web.controller;

import cn.itsource.ymcc.result.JsonResult;
import cn.itsource.ymcc.util.StrUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderCommonController {
    @Autowired
    private RedisTemplate<String,Object> redisTemplate;

    @GetMapping("/createToken")
    public JsonResult createToken(){
        String token = StrUtils.getComplexRandomString(16);
        redisTemplate.opsForValue().set(token,"");
        return JsonResult.success().setData(token);
    }
}
